home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / sys-include / gl / glu.h < prev    next >
C/C++ Source or Header  |  2000-03-13  |  15KB  |  435 lines

  1. /* $Id: glu.h,v 3.2 1998/07/26 01:36:27 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  3.0
  6.  * Copyright (C) 1995-1998  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: glu.h,v $
  26.  * Revision 3.2  1998/07/26 01:36:27  brianp
  27.  * changes for Windows compilation per Ted Jump
  28.  *
  29.  * Revision 3.1  1998/06/23 00:33:08  brianp
  30.  * added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge)
  31.  *
  32.  * Revision 3.0  1998/02/20 05:06:01  brianp
  33.  * initial rev
  34.  *
  35.  */
  36.  
  37.  
  38. #ifndef GLU_H
  39. #define GLU_H
  40.  
  41.  
  42. #if defined(USE_MGL_NAMESPACE)
  43. #include "glu_mangle.h"
  44. #endif
  45.  
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51.  
  52. #include "GL/gl.h"
  53.  
  54.         /* to facilitate clean DLL building ... */
  55. #if defined(__WIN32__) || defined(__CYGWIN32__)
  56. #if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
  57. #define GLUAPI __declspec(dllexport)
  58. #elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
  59. #define GLUAPI __declspec(dllimport)
  60. #else /* for use with static link lib build of Win32 edition only */
  61. #define GLUAPI extern
  62. #endif /* _STATIC_MESA support */
  63. #else
  64. #define GLUAPI
  65. #endif /* WIN32 / CYGWIN32 bracket */
  66.  
  67. #ifdef macintosh
  68.         #pragma enumsalwaysint on
  69.         #if PRAGMA_IMPORT_SUPPORTED
  70.         #pragma import on
  71.         #endif
  72. #endif
  73.  
  74.  
  75. #define GLU_VERSION_1_1         1
  76.  
  77.  
  78. #define GLU_TRUE   GL_TRUE
  79. #define GLU_FALSE  GL_FALSE
  80.  
  81.  
  82. enum {
  83.         /* Normal vectors */
  84.         GLU_SMOOTH      = 100000,
  85.         GLU_FLAT        = 100001,
  86.         GLU_NONE        = 100002,
  87.  
  88.         /* Quadric draw styles */
  89.         GLU_POINT       = 100010,
  90.         GLU_LINE        = 100011,
  91.         GLU_FILL        = 100012,
  92.         GLU_SILHOUETTE  = 100013,
  93.  
  94.         /* Quadric orientation */
  95.         GLU_OUTSIDE     = 100020,
  96.         GLU_INSIDE      = 100021,
  97.  
  98.         /* Tesselator */
  99.         GLU_BEGIN       = 100100,
  100.         GLU_VERTEX      = 100101,
  101.         GLU_END         = 100102,
  102.         GLU_ERROR       = 100103,
  103.         GLU_EDGE_FLAG   = 100104,
  104.  
  105.         /* Contour types */
  106.         GLU_CW          = 100120,
  107.         GLU_CCW         = 100121,
  108.         GLU_INTERIOR    = 100122,
  109.         GLU_EXTERIOR    = 100123,
  110.         GLU_UNKNOWN     = 100124,
  111.  
  112.         /* Tesselation errors */
  113.         GLU_TESS_ERROR1 = 100151,  /* missing gluEndPolygon */
  114.         GLU_TESS_ERROR2 = 100152,  /* missing gluBeginPolygon */
  115.         GLU_TESS_ERROR3 = 100153,  /* misoriented contour */
  116.         GLU_TESS_ERROR4 = 100154,  /* vertex/edge intersection */
  117.         GLU_TESS_ERROR5 = 100155,  /* misoriented or self-intersecting loops */
  118.         GLU_TESS_ERROR6 = 100156,  /* coincident vertices */
  119.         GLU_TESS_ERROR7 = 100157,  /* all vertices collinear */
  120.         GLU_TESS_ERROR8 = 100158,  /* intersecting edges */
  121.         GLU_TESS_ERROR9 = 100159,  /* not coplanar contours */
  122.  
  123.         /* NURBS */
  124.         GLU_AUTO_LOAD_MATRIX    = 100200,
  125.         GLU_CULLING             = 100201,
  126.         GLU_PARAMETRIC_TOLERANCE= 100202,
  127.         GLU_SAMPLING_TOLERANCE  = 100203,
  128.         GLU_DISPLAY_MODE        = 100204,
  129.         GLU_SAMPLING_METHOD     = 100205,
  130.         GLU_U_STEP              = 100206,
  131.         GLU_V_STEP              = 100207,
  132.  
  133.         GLU_PATH_LENGTH         = 100215,
  134.         GLU_PARAMETRIC_ERROR    = 100216,
  135.         GLU_DOMAIN_DISTANCE     = 100217,
  136.  
  137.         GLU_MAP1_TRIM_2         = 100210,
  138.         GLU_MAP1_TRIM_3         = 100211,
  139.  
  140.         GLU_OUTLINE_POLYGON     = 100240,
  141.         GLU_OUTLINE_PATCH       = 100241,
  142.  
  143.         GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
  144.         GLU_NURBS_ERROR2  = 100252,   /* too few knots */
  145.         GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
  146.         GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
  147.         GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
  148.         GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
  149.         GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
  150.         GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
  151.         GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
  152.         GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
  153.         GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
  154.         GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
  155.         GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
  156.         GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
  157.         GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
  158.         GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
  159.         GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
  160.         GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
  161.         GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
  162.         GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
  163.         GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
  164.         GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
  165.         GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
  166.         GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
  167.         GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
  168.         GLU_NURBS_ERROR26 = 100276,   /* invalid property */
  169.         GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
  170.         GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
  171.         GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
  172.         GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
  173.         GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
  174.         GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
  175.         GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
  176.         GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
  177.         GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
  178.         GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
  179.         GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
  180.  
  181.         /* Errors */
  182.         GLU_INVALID_ENUM                = 100900,
  183.         GLU_INVALID_VALUE               = 100901,
  184.         GLU_OUT_OF_MEMORY               = 100902,
  185.         GLU_INCOMPATIBLE_GL_VERSION     = 100903,
  186.  
  187.         /* New in GLU 1.1 */
  188.         GLU_VERSION     = 100800,
  189.         GLU_EXTENSIONS  = 100801
  190. };
  191.  
  192.  
  193. /*
  194.  * These are the GLU 1.1 typedefs.  GLU 1.2 has different ones!
  195.  */
  196. typedef struct GLUquadricObj GLUquadricObj;
  197.  
  198. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  199.  
  200. typedef struct GLUnurbsObj GLUnurbsObj;
  201.  
  202.  
  203.  
  204. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  205. #pragma export on
  206. #endif
  207.  
  208. #if defined(__STORM__) && defined(__PPC__) && !defined(COMPILING_GLU)
  209. #include <stormprotos/glu_sprotos.h>
  210. #else
  211.  
  212. /*
  213.  *
  214.  * Miscellaneous functions
  215.  *
  216.  */
  217.  
  218. GLUAPI void APIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
  219.                                 GLdouble centerx, GLdouble centery,
  220.                                 GLdouble centerz,
  221.                                 GLdouble upx, GLdouble upy, GLdouble upz );
  222.  
  223.  
  224. GLUAPI void APIENTRY gluOrtho2D( GLdouble left, GLdouble right,
  225.                                  GLdouble bottom, GLdouble top );
  226.  
  227.  
  228. GLUAPI void APIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
  229.                                      GLdouble zNear, GLdouble zFar );
  230.  
  231.  
  232. GLUAPI void APIENTRY gluPickMatrix( GLdouble x, GLdouble y,
  233.                                     GLdouble width, GLdouble height,
  234.                                     const GLint viewport[4] );
  235.  
  236. GLUAPI GLint APIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
  237.                                   const GLdouble modelMatrix[16],
  238.                                   const GLdouble projMatrix[16],
  239.                                   const GLint viewport[4],
  240.                                   GLdouble *winx, GLdouble *winy,
  241.                                   GLdouble *winz );
  242.  
  243. GLUAPI GLint APIENTRY gluUnProject( GLdouble winx, GLdouble winy,
  244.                                     GLdouble winz,
  245.                                     const GLdouble modelMatrix[16],
  246.                                     const GLdouble projMatrix[16],
  247.                                     const GLint viewport[4],
  248.                                     GLdouble *objx, GLdouble *objy,
  249.                                     GLdouble *objz );
  250.  
  251. GLUAPI const GLubyte* APIENTRY gluErrorString( GLenum errorCode );
  252.  
  253.  
  254.  
  255. /*
  256.  *
  257.  * Mipmapping and image scaling
  258.  *
  259.  */
  260.  
  261. GLUAPI GLint APIENTRY gluScaleImage( GLenum format,
  262.                                      GLint widthin, GLint heightin,
  263.                                      GLenum typein, const void *datain,
  264.                                      GLint widthout, GLint heightout,
  265.                                      GLenum typeout, void *dataout );
  266.  
  267. GLUAPI GLint APIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
  268.                                          GLint width, GLenum format,
  269.                                          GLenum type, const void *data );
  270.  
  271. GLUAPI GLint APIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
  272.                                          GLint width, GLint height,
  273.                                          GLenum format,
  274.                                          GLenum type, const void *data );
  275.  
  276.  
  277.  
  278. /*
  279.  *
  280.  * Quadrics
  281.  *
  282.  */
  283.  
  284. GLUAPI GLUquadricObj* APIENTRY gluNewQuadric( void );
  285.  
  286. GLUAPI void APIENTRY gluDeleteQuadric( GLUquadricObj *state );
  287.  
  288. GLUAPI void APIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
  289.                                           GLenum drawStyle );
  290.  
  291. GLUAPI void APIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
  292.                                             GLenum orientation );
  293.  
  294. GLUAPI void APIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
  295.                                         GLenum normals );
  296.  
  297. GLUAPI void APIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
  298.                                         GLboolean textureCoords );
  299.  
  300. GLUAPI void APIENTRY gluQuadricCallback( GLUquadricObj *qobj,
  301.                                          GLenum which, void (CALLBACK *fn)() );
  302.  
  303. GLUAPI void APIENTRY gluCylinder( GLUquadricObj *qobj,
  304.                                   GLdouble baseRadius,
  305.                                   GLdouble topRadius,
  306.                                   GLdouble height,
  307.                                   GLint slices, GLint stacks );
  308.  
  309. GLUAPI void APIENTRY gluSphere( GLUquadricObj *qobj,
  310.                                 GLdouble radius, GLint slices, GLint stacks );
  311.  
  312. GLUAPI void APIENTRY gluDisk( GLUquadricObj *qobj,
  313.                               GLdouble innerRadius, GLdouble outerRadius,
  314.                               GLint slices, GLint loops );
  315.  
  316. GLUAPI void APIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
  317.                                      GLdouble outerRadius, GLint slices,
  318.                                      GLint loops, GLdouble startAngle,
  319.                                      GLdouble sweepAngle );
  320.  
  321.  
  322.  
  323. /*
  324.  *
  325.  * Nurbs
  326.  *
  327.  */
  328.  
  329. GLUAPI GLUnurbsObj* APIENTRY gluNewNurbsRenderer( void );
  330.  
  331. GLUAPI void APIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
  332.  
  333. GLUAPI void APIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
  334.                                               const GLfloat modelMatrix[16],
  335.                                               const GLfloat projMatrix[16],
  336.                                               const GLint viewport[4] );
  337.  
  338. GLUAPI void APIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  339.                                        GLfloat value );
  340.  
  341. GLUAPI void APIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  342.                                           GLfloat *value );
  343.  
  344. GLUAPI void APIENTRY gluBeginCurve( GLUnurbsObj *nobj );
  345.  
  346. GLUAPI void APIENTRY gluEndCurve( GLUnurbsObj * nobj );
  347.  
  348. GLUAPI void APIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
  349.                                     GLfloat *knot, GLint stride,
  350.                                     GLfloat *ctlarray, GLint order,
  351.                                     GLenum type );
  352.  
  353. GLUAPI void APIENTRY gluBeginSurface( GLUnurbsObj *nobj );
  354.  
  355. GLUAPI void APIENTRY gluEndSurface( GLUnurbsObj * nobj );
  356.  
  357. GLUAPI void APIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
  358.                                       GLint sknot_count, GLfloat *sknot,
  359.                                       GLint tknot_count, GLfloat *tknot,
  360.                                       GLint s_stride, GLint t_stride,
  361.                                       GLfloat *ctlarray,
  362.                                       GLint sorder, GLint torder,
  363.                                       GLenum type );
  364.  
  365. GLUAPI void APIENTRY gluBeginTrim( GLUnurbsObj *nobj );
  366.  
  367. GLUAPI void APIENTRY gluEndTrim( GLUnurbsObj *nobj );
  368.  
  369. GLUAPI void APIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
  370.                                   GLfloat *array, GLint stride, GLenum type );
  371.  
  372. GLUAPI void APIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
  373.                                        void (CALLBACK *fn)() );
  374.  
  375.  
  376.  
  377. /*
  378.  *
  379.  * Polygon tesselation
  380.  *
  381.  */
  382.  
  383. GLUAPI GLUtriangulatorObj* APIENTRY gluNewTess( void );
  384.  
  385. GLUAPI void APIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
  386.                                       void (CALLBACK *fn)() );
  387.  
  388. GLUAPI void APIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
  389.  
  390. GLUAPI void APIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
  391.  
  392. GLUAPI void APIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
  393.  
  394. GLUAPI void APIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
  395.  
  396. GLUAPI void APIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
  397.                                     void *data );
  398.  
  399.  
  400.  
  401. /*
  402.  *
  403.  * New functions in GLU 1.1
  404.  *
  405.  */
  406.  
  407. GLUAPI const GLubyte* APIENTRY gluGetString( GLenum name );
  408.  
  409. #if defined(__VBCC__) && (defined(GL_INLINE) || defined(__PPC__))
  410. #include <proto/glu.h>
  411. #endif
  412.  
  413. #endif /* __STORM__ && __PPC__ */
  414.  
  415.  
  416. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  417. #pragma export off
  418. #endif
  419.  
  420.  
  421. #ifdef macintosh
  422.         #pragma enumsalwaysint reset
  423.         #if PRAGMA_IMPORT_SUPPORTED
  424.         #pragma import off
  425.         #endif
  426. #endif
  427.  
  428.  
  429. #ifdef __cplusplus
  430. }
  431. #endif
  432.  
  433.  
  434. #endif
  435.